package com.luo.pojo.information;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author Pro Luo
 * @since 2020-08-05
 *    示例实体类
 */
//@ApiModel(value="Information对象", description="")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Information implements Serializable {

    private static final long serialVersionUID = 1L;

//    @ApiModelProperty(value = "资讯id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

//    @ApiModelProperty(value = "标题")
    private String title;

//    @ApiModelProperty(value = "封面")
    private String cover;

//    @ApiModelProperty(value = "简介")
    private String instruction;

//    @ApiModelProperty(value = "作者")
    private String author;

//    @ApiModelProperty(value = "内容")
    private String content;

//    @ApiModelProperty(value = "点赞数")
    @TableField(update = "%s+1")
    private Integer likeNum;

//    @ApiModelProperty(value = "阅读数")
    @TableField(update = "%s+1")
    private Integer readNum;

//    @ApiModelProperty(value = "收藏数")
    @TableField(update = "%s+1")
    private Integer collectionNum;

//    @ApiModelProperty(value = "评论数")
    @TableField(update = "%s+1")
    private Integer commentNum;

//    @ApiModelProperty(value = "是否为转载资讯")
    private Integer ifReprint;

//    @ApiModelProperty(value = "是否推荐")
    private Integer ifRecommended;

//    @ApiModelProperty(value = "是否开启评论")
    private Integer ifComment;

//    @ApiModelProperty(value = "对应资讯分类id")
    @TableField("information_classifyId")
    private Integer informationClassifyid;

//    @ApiModelProperty(value = "创建用户的id")
    private Integer userId;

//    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

//    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Override
    public String toString() {
        return
                "资讯标题:   " + title + '\n' +
                "资讯修改时间:   " + createTime+ '\n' +
                "资讯作者:   " + author + '\n' +
                "作者ID:    " + userId + '\n' +
                "资讯评论人数:   " + commentNum + '\n' +
                "资讯内容:   " + "\n" + content + '\n'+'\n';
    }

}
